package mysql

import (
	"month_zg5/book_srv/common/global"
	"month_zg5/book_srv/models"
)

func GetUserByUsername(username string) (*models.User, error) {
	user := new(models.User)
	return user, global.DB.Where("username = ?", username).First(&user).Error
}
func RegisterUser(user *models.User) (*models.User, error) {
	return user, global.DB.Create(&user).Error
}
